-
Notifications
You must be signed in to change notification settings - Fork 3k
Add an array from function #10304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an array from function #10304
Conversation
CT Test Results 2 files 97 suites 1h 7m 27s ⏱️ Results for commit 8f7ccf5. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts
// Erlang/OTP Github Action Bot |
|
I wonder if it should be called |
Thanks for the suggestion. Discussed this but we think it is fine as it is, the other Other functions that uses a |
96771ad to
5f8b7c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds new from/2 and from/3 functions to the array module that create arrays by iteratively calling a function with a state until it returns done. This provides a more flexible way to construct arrays compared to from_list/1.
- Adds
array:from/2andarray:from/3functions to build arrays from a generator function - Includes comprehensive test coverage with
from_test_()and real-world examples inimport_export/1 - Adds doctest integration via
doctests/1test case
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lib/stdlib/src/array.erl | Implements the from/2 and from/3 functions with documentation and helper functions |
| lib/stdlib/test/array_SUITE.erl | Adds test cases for the new functions including unit tests, integration tests, and doctests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5f8b7c2 to
2dc2827
Compare
To allow array creation from any type of input, for example from binaries without the need to first create a redundant list.
2dc2827 to
8f7ccf5
Compare
To allow array creation from any type of input, for example from binaries without the need to first create a redundant list.